home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / online / files / fedemon.exe / {app} / Data / defaults / styles / TwoCube.fdxsl < prev   
Encoding:
Extensible Markup Language  |  2004-09-01  |  4.0 KB  |  118 lines

  1. ∩╗┐<?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
  6. <xsl:output method="html"/>
  7.  
  8. <!-- store count of items -->
  9. <xsl:variable name="item-count" select="count(newspaper/channel/item)"/>
  10.  
  11. <xsl:variable name="common-styles">
  12.     <style type="text/css">
  13.         body {
  14.             font: x-small "Trebuchet MS", Tahoma, sans-serif;
  15.             color: black;
  16.             margin: 0;
  17.             padding: 0;
  18.             background-color: #EAF4F4;            
  19.             filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#F7FCFC,endColorStr=#89B9BA);
  20.         }
  21.         span.nodescription {    font-size: x-small; color: silver;}
  22.         div.newspapertitle { font-weight: bold; font-size: 130%; text-align: center; margin: 10px 0; }
  23.  
  24.         div.newsitemcontent, div.newsitemfooter { padding: 10px 20px; }
  25.         div.newsitemcontent a, div.newsitemfooter a { color: #336666;  }
  26.         div.newsitemcontent a:hover, div.newsitemfooter a:hover { color: #9966CC; }
  27.         div.newsitemfooter { font-size: xx-small; text-align: right; font-style: italic  }
  28.         div.newsitemtitle { width: 100%; padding: 8px 20px; font-weight: bold; background-color: #6EB5B6; }
  29.         div.newsitemtitle a { text-decoration: none; color: white; }
  30.         div.newsitemtitle a:hover { text-decoration: underline;}
  31.  
  32.         div.newsitem {
  33.             background-color: white;
  34.             border: 1px solid #336666;
  35.             border-right-width: 2px;
  36.             border-bottom-width: 2px;
  37.             overflow: auto;
  38.             scrollbar-base-color: #BAD7D8;
  39.             scrollbar-darkshadow-color: #EAF4F4;
  40.             margin: 4px 6px;
  41.             text-align: left;
  42.             <xsl:choose>
  43.                 <xsl:when test="newspaper[@type='newsitem']">
  44.                     /* show single news item newspaper full page*/
  45.                     height: 98%;
  46.                 </xsl:when>
  47.                 <xsl:when test="$item-count = 1">
  48.                     /* same for channel and group newspapers with single item, but allow room for headline */
  49.                     height: 91%;
  50.                 </xsl:when>                
  51.                 <xsl:when test="$item-count = 2">
  52.                     /* when only two items, show full page side-by-side */
  53.                     height: 90%;
  54.                     width: 45%;
  55.                     float: left;
  56.                 </xsl:when>
  57.                 <xsl:otherwise>
  58.                     /* otherwise show half page side-by-side */
  59.                     height: 44%;
  60.                     width: 45%;
  61.                     float: left;
  62.                 </xsl:otherwise>
  63.             </xsl:choose>
  64.         }
  65.     </style>
  66. </xsl:variable>
  67.  
  68. <xsl:template match="newspaper">
  69.     <html>
  70.     <head>
  71.         <title>Newspaper</title>
  72.         <xsl:copy-of select="$common-styles"/>
  73.     </head>
  74.     <body>
  75.         <xsl:if test="title">
  76.             <div class="newspapertitle">
  77.                 <xsl:value-of select="title" disable-output-escaping="yes"/>
  78.             </div>
  79.         </xsl:if>
  80.         <xsl:for-each select="channel/item">
  81.             <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
  82.             <!-- <xsl:sort select="title"/> -->
  83.             <xsl:apply-templates select="."/>
  84.         </xsl:for-each>
  85.     </body>
  86.     </html>    
  87. </xsl:template>
  88.  
  89. <!-- news item template -->
  90. <xsl:template match="item">
  91.     <div class="newsitem">
  92.         <div class="newsitemtitle">
  93.             <xsl:variable name="itemlink" select="link"/>
  94.            <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
  95.         </div>
  96.         <div class="newsitemcontent">
  97.             <xsl:value-of select="description" disable-output-escaping="yes"/>
  98.         </div>
  99.         <div class="newsitemfooter">
  100.             <xsl:variable name="srclink" select="source/@htmlUrl"/>
  101.             <xsl:value-of select="fd:dateDisplay"/> | <a href="{$srclink}"><xsl:value-of select="source"/></a>
  102.             <!-- add link to comments if available -->
  103.             <xsl:if test="comments">
  104.                 <xsl:variable name="commentlink" select="comments"/>
  105.                 <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
  106.                 | <a href="{$commentlink}"><img src="{$commentimg}" border="0" hspace="6"/></a>
  107.             </xsl:if>
  108.             <!-- add link to enclosure if available -->
  109.             <xsl:if test="enclosure">
  110.                 <xsl:variable name="enclosurelink" select="enclosure/@url"/>
  111.                 <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
  112.                 | <a href="{$enclosurelink}"><img src="{$enclosureimg}" border="0" hspace="6"/></a>
  113.             </xsl:if>
  114.         </div>
  115.     </div>
  116. </xsl:template>
  117.  
  118. </xsl:stylesheet>